package com.iknow.data;

import android.os.Parcel;
import android.os.Parcelable;
import com.iknow.util.Loger;
import com.iknow.util.StringUtil;
import org.json.JSONException;
import org.json.JSONObject;

public class Comment
  implements Parcelable
{
  private String mData;
  private String mDate;
  private String mID;
  private String mUID;
  private String mUName;

  public Comment(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5)
  {
    this.mID = paramString1;
    this.mUID = paramString2;
    this.mUName = paramString3;
    this.mDate = paramString4;
    this.mData = paramString5;
  }

  public Comment(JSONObject paramJSONObject)
  {
    try
    {
      this.mID = paramJSONObject.getString("comment_id");
      this.mDate = paramJSONObject.getString("time");
      this.mData = paramJSONObject.getString("text");
      if (paramJSONObject.has("user_id"))
        this.mUID = paramJSONObject.getString("user_id");
      if (paramJSONObject.has("user_name"))
        this.mUName = paramJSONObject.getString("user_name");
      return;
    }
    catch (JSONException localJSONException)
    {
      Loger.e("Comment", localJSONException.getMessage());
    }
  }

  public int describeContents()
  {
    return 0;
  }

  public String getData()
  {
    return this.mData;
  }

  public String getDate()
  {
    return this.mDate;
  }

  public String getId()
  {
    return this.mID;
  }

  public String getUName()
  {
    String str;
    if (StringUtil.isEmpty(this.mUName))
      str = "网友";
    while (true)
    {
      return str;
      str = this.mUName;
    }
  }

  public String getUid()
  {
    return this.mUID;
  }

  public void setName(String paramString)
  {
    this.mUName = paramString;
  }

  public void writeToParcel(Parcel paramParcel, int paramInt)
  {
  }
}